package com.example.trb.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.trb.validation.DateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;
import javax.validation.constraints.Pattern;

@Data
@TableName("title_rating.education")
@AllArgsConstructor
public class Education {




    @TableId(type = IdType.AUTO)
    private Integer id;
    private Integer userId;

    @NotNull(message = "毕业时间不能为空")
    @DateTime(format = "yyyy-MM-dd", message = "毕业时间的格式为yyyy-MM-dd")
    private String graduationTime;

    @NotBlank(message = "毕业学校不能为空")
    private String school;

    @NotBlank(message = "专业不能为空")
    private String specialty;

    @NotBlank(message = "学制不能为空")
    @Pattern(regexp = "三年|四年")
    private String academicStructure;

    @NotBlank(message = "毕业证书不能为空")
    @Length(min = 18, max = 19)
    private String educationNumber;

    @NotBlank(message = "学位不能为空")
    @Pattern(regexp = "硕士|学士|博士")
    private String degree;

    @NotBlank(message = "学历证明材料不能为空")
    @URL
    private String materials;

    @Pattern(regexp = "待审核|未通过|已通过")
    private String status;
}
